package com.kaifamiao.www.demo.do0821;

import java.util.*;

public class Demo {
    public static void main(String[] args) {
        //工具类
        List list = Collections.EMPTY_LIST;

        System.out.println(list.size());
        System.out.println(list.isEmpty());

        List<Integer> list1 = new ArrayList<>();
//        list1.add(1);
//        list1.add(2);
//        list1.add(3);
        list1.addAll(Collections.unmodifiableList(Arrays.asList(1, 23, 2, 3, 4, 5)));
        Collections.addAll(list1, 1, 2, 3, 4, 5);
        System.out.println(list1);
        LinkedList<Integer> linkedList = new LinkedList<>();
        Collections.addAll(linkedList, 2, 4, 1, 3, 0);
        System.out.println(linkedList);

        //LIFO队列
        Queue<Integer> queue = Collections.asLifoQueue(linkedList);
        queue.add(7);
        System.out.println(queue);

        Stack<Integer> stack = new Stack<>();
        stack.push(1);
        stack.push(2);
        System.out.println(stack.peek());
    }
}